#include "remote.h"
unsigned char sbus_rx_buffer1[RC_FRAME_LENGTH];
unsigned char sbus_rx_buffer2[RC_FRAME_LENGTH];
 RC_Ctl_t RC_CtrlData;

void RemoteDataProcess(uint8_t *pData)
{
 if(pData == NULL)
 {
 return;
 }

 RC_CtrlData.rc.ch0 = (pData[0] | (pData[1] << 8)) & 0x07FF;
 RC_CtrlData.rc.ch1 = ((pData[1] >> 3) | (pData[2] << 5))
& 0x07FF;
 RC_CtrlData.rc.ch2 = ((pData[2] >> 6) | (pData[3] << 2) |
 (pData[4] << 10)) & 0x07FF;
 RC_CtrlData.rc.ch3 = ((pData[4] >> 1) | (pData[5]<<7)) &
0x07FF;

 RC_CtrlData.rc.s1 = ((pData[5] >> 4) & 0x000C) >> 2;
 RC_CtrlData.rc.s2 = ((pData[5] >> 4) & 0x0003);
// RC_CtrlData.mouse.x = (pData[6]) | (pData[7] << 8);
// RC_CtrlData.mouse.y = (pData[8]) | (pData[9] << 8);
// RC_CtrlData.mouse.z = (pData[10]) | (pData[11] << 8);
// RC_CtrlData.mouse.press_l = pData[12];
// RC_CtrlData.mouse.press_r = pData[13];
// RC_CtrlData.key.v = (pData[14]);// | ((int16_t)pData[15] << 8);
 //your control code ….
}
